package com.nineclock.doc.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.doc.dto.DocFileDto;
import com.nineclock.doc.dto.DocFolderDto;
import com.nineclock.doc.service.DocFileDtoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping
public class DocFileDtoController {
    
    @Autowired
    DocFileDtoService fileDtoService;
    
    @PostMapping("/insertFile")
    public Result addDopController(@RequestBody DocFileDto docFileDto) {
        fileDtoService.addDopController(docFileDto);
        return Result.success();
    }
    
    @GetMapping("/queryFile")
    public Result<List<DocFileDto>> queryCompanyMemberList() {
        List<DocFileDto> docFileDTOList = fileDtoService.queryCompanyMemberList();
        return Result.success(docFileDTOList);
    }
    
    @GetMapping("/queryFiles")
    public Result<List<DocFolderDto>> queryListDis() {
        List<DocFolderDto> docFolderDtos = fileDtoService.queryListDis();
        return Result.success(docFolderDtos);
    }
}
